package com.yqd.lesson.remote

import akka.actor.{ActorSystem, Props}
import com.typesafe.config.ConfigFactory

import scala.concurrent.duration._
import scala.util.Random

object LookUpApp extends App{


  val system =
    ActorSystem("LookupSystem", ConfigFactory.load("remotelookup"))

  val remotePath =
    "akka.tcp://CalculatorSystem@127.0.0.1:2552/user/calculator"
  var actor = system.actorOf(Props(classOf[LookUpActor],remotePath),"lookupActor");

  import system.dispatcher
  system.scheduler.schedule(1.second, 1.second) {
    actor ! Add(Random.nextInt(100), Random.nextInt(100))
  }
}
